<%@ page contentType="text/html;charset=GB2312"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="com.monlyu.bo.ManuscriptBo"%>
<%@page import="com.monlyu.listener.InitDataListener"%>
<%@page import="java.io.InputStream"%>
<%@ page import="java.sql.*"%>
<%
	Long did = Long.parseLong(request.getParameter("id"));
	System.out.println(did);
	ManuscriptBo bo = (ManuscriptBo) InitDataListener
			.getBeanById("manuscriptBo");
	InputStream in = bo.getStream(did);
	System.out.println(in);
	out.clear();
	out = pageContext.pushBody();
	//pageContext.getRequest().setCharacterEncoding("");
	response.reset();
	response.setContentType("application/vnd.ms-word");
	java.io.OutputStream outStream = response.getOutputStream();
	System.out.println(outStream);
	byte[] buf = new byte[1024];
	int bytes = 0;
	while ((bytes = in.read(buf)) != -1)
		outStream.write(buf, 0, bytes);
	in.close();
	outStream.close();
%>